import request from '@/utils/request'

// 查询交易账号列表
export function listTradeAccount(query) {
  return request({
    url: '/business/tradeAccount/list',
    method: 'get',
    params: query
  })
}

// 查询交易账号详细
export function getTradeAccount(id) {
  return request({
    url: '/business/tradeAccount/' + id,
    method: 'get'
  })
}

// 新增交易账号
export function addTradeAccount(data) {
  return request({
    url: '/business/tradeAccount',
    method: 'post',
    data: data
  })
}

// 修改交易账号
export function updateTradeAccount(data) {
  return request({
    url: '/business/tradeAccount',
    method: 'put',
    data: data
  })
}

// 删除交易账号
export function delTradeAccount(id) {
  return request({
    url: '/business/tradeAccount/' + id,
    method: 'delete'
  })
}

//查询委托订单
export function getOrder(tdAcc) {
  return request({
    url: '/business/tradeAccount/getOrder/'+tdAcc,
    method: 'get'
  })
}

//订单成交
export function entrustOrder(data) {
  return request({
    url: '/business/order/entrustOrderInsert',
    method: 'post',
    data: data
  })
}
